<?php
namespace app\erp\validate;
use think\Validate;
class SiteConfigrule extends Validate{
    protected $rule = [
        'config_name' => 'require|unique:siteConfig,config_name^partner_id^site_id',
        'view_sort'=>'number'
    ];
    protected $message = [
        'config_name.require' => '配置名称必须填写',
        'config_name.unique' => '配置名称已存在',
        'view_sort.number' => '配置排序只能是数字'
    ];
    protected $scene = [
        'edit' => [
            'config_name' => 'unique:siteConfig,config_name^partner_id^site_id',
            'view_sort' => 'number'
        ]
    ];
}